package com.sharecode.stock.repository;

import java.util.List;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import com.sharecode.stock.vo.stock.StockHistory;

public interface StockHistoryRepository extends JpaRepository<StockHistory, Long> {

	List<StockHistory> findByCodeAndCycleOrderByDate(String code,int cycle);

	@Query(value = "FROM StockHistory s WHERE s.code=:code AND s.date>= :startDate AND s.date<=:endDate ORDER BY s.date")
	List<StockHistory> findByParam(@Param(value = "code") String code, @Param(value = "startDate") String startDate, @Param(value = "endDate") String endDate);

}
